UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4/bxHMncSUSTLkjsCRBanB01UZ5PsnqFvGuAt1/nfks=' 
WHERE 
  key_id = '6d2d3ee882b2ad9257641e2c636f4d6627f5643c06ea46daf9fd02fa128f35a6' 
  AND (
    token = '4/bxHMncSUSTLkjsCRBanB01UZ5PsnqFvGuAt1/nfks=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021