UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8P4qVlVgWVvCQl8XyXHTXL/pCaG3L7+EW0nVotR7fQ8=' 
WHERE 
  key_id = '4213aadc00c5506dcec684fbb5f7b3d7a2f2bb73d98299abd15b384d4da8ce71' 
  AND (
    token = '8P4qVlVgWVvCQl8XyXHTXL/pCaG3L7+EW0nVotR7fQ8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040