UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8lathqHmzMAfb6B9lI3mxAVjjNQNhnVCLe8nViqLOi4=' 
WHERE 
  key_id = '493d90c76235cbed344240c3b1c78b73dc8a88c1fbd87c8d6bf60600d5c81fdd' 
  AND (
    token = '8lathqHmzMAfb6B9lI3mxAVjjNQNhnVCLe8nViqLOi4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019