UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZucyeDYLlTSnMTpAXFKmDaCWQYWErgq8G76D0fPKVoY=' 
WHERE 
  key_id = '7d2756a40a5475454ebc7e4532fa67396ec042aaff4900a30c030b4bb0e1a910' 
  AND (
    token = 'ZucyeDYLlTSnMTpAXFKmDaCWQYWErgq8G76D0fPKVoY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037