UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'khwRw+LKab+Utw63TCPve0HJ9jDYGCIUhm4D37AZhJk=' 
WHERE 
  key_id = '86e7bf5756fdd9706ab965ae373ee0ae75c603293d74e59c215cfc328daa513e' 
  AND (
    token = 'khwRw+LKab+Utw63TCPve0HJ9jDYGCIUhm4D37AZhJk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028