UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'E8QlmDJ76qvTC7KFUIFB1e8CdwlhqxZlLpU9Lp9mFH0=' 
WHERE 
  key_id = '3ebeb31695039536c17b9ca7c395ad0d02c11fc377e8ea4025c6680ad80b7e6c' 
  AND (
    token = 'E8QlmDJ76qvTC7KFUIFB1e8CdwlhqxZlLpU9Lp9mFH0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033