UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '26b8V9gnsdmqffAFixzZn/0dnc5tggFVf+uLCFvnwK8=' 
WHERE 
  key_id = '07d39b2d39ee07b2822a2ad69d640f4e78474ac3053def972d1152c29dcec83d' 
  AND (
    token = '26b8V9gnsdmqffAFixzZn/0dnc5tggFVf+uLCFvnwK8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028