UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'T1F87sruHaQ+mRrVlcGHC1nV+Cw1nUcGFTvDylCEHNs=' 
WHERE 
  key_id = '03d55945d66d4ef96fc0740008dc976256f1ba554540ea3ea608a98eb0b716a6' 
  AND (
    token = 'T1F87sruHaQ+mRrVlcGHC1nV+Cw1nUcGFTvDylCEHNs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00060