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

Query time 0.00028