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

Query time 0.00052