UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hwuzHx4SC2oTR59VIKMo7B3NJQ907Zrn3m3o/x6ws5g=' 
WHERE 
  key_id = '41f0229c3acfca93327be427ece66334a7d30e456af3d39cc283679826f39799' 
  AND (
    token = 'hwuzHx4SC2oTR59VIKMo7B3NJQ907Zrn3m3o/x6ws5g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030