UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TwsagpdGZf7gDKh/VP+E+PpQGpHF06Wb/vHGtFN8pvc=' 
WHERE 
  key_id = 'a62a54eb8ca1f00426279a773685d3c127ec8f1162cbcb10a3e8a42acccca0fd' 
  AND (
    token = 'TwsagpdGZf7gDKh/VP+E+PpQGpHF06Wb/vHGtFN8pvc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036