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

Query time 0.00038