UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hH3ioOWkXD6j2+tXdVh2I+Jc3ZQe0cK9yvGhUgvcf44=' 
WHERE 
  key_id = '9a193d1bc95753f65ec38d57f1119bcea787983ec0a07eebe34569564ac85b37' 
  AND (
    token = 'hH3ioOWkXD6j2+tXdVh2I+Jc3ZQe0cK9yvGhUgvcf44=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042