UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eB14PYAEhU5C3MMFmrl7VHd/KazaaZl3jpm98S3KkzE=' 
WHERE 
  key_id = '888320f19fc036f5400c1e2cb2e26c89c746f52cbee9586dbe7dd7494bfd65f6' 
  AND (
    token = 'eB14PYAEhU5C3MMFmrl7VHd/KazaaZl3jpm98S3KkzE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023