UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'e3Ja8p1Ck3H9S7Fqw2Nbemme0YAGxZWBX3NpkrsHI/o=' 
WHERE 
  key_id = '44333b064d2b9ba2e94809ee6ec60c1fcf98d646914bfa2b262e319df707b6a4' 
  AND (
    token = 'e3Ja8p1Ck3H9S7Fqw2Nbemme0YAGxZWBX3NpkrsHI/o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023