UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jogiS3t3unshgzLfe2ZBZgX3ZiFZYkSwQamYSoQBnwA=' 
WHERE 
  key_id = 'ec64d08132970ef3d22bcdf1a9d6d44eee6c84ebebb2daad87f9ab377ffcbcfe' 
  AND (
    token = 'jogiS3t3unshgzLfe2ZBZgX3ZiFZYkSwQamYSoQBnwA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029