UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ef3rnd5FX4RfDD4Wh12MpKI56nwNq3sHPJp3BZM+gJs=' 
WHERE 
  key_id = 'e6c346d129f7ecb1958b5a8b2bc68b8170a78aa40dd2e4a6f78f5cfb0c7061cb' 
  AND (
    token = 'Ef3rnd5FX4RfDD4Wh12MpKI56nwNq3sHPJp3BZM+gJs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056