UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0H7T3yHDUzvsAWS8QxBNZdTHoXV+71omjm2AbbjNr3I=' 
WHERE 
  key_id = '5335585bc1e4a46d107646a59b95a1f53ed0b43e770531006f0ba187b45f34b6' 
  AND (
    token = '0H7T3yHDUzvsAWS8QxBNZdTHoXV+71omjm2AbbjNr3I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034