UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NdeC3qNZ74fNegtoIIk1zGQYK9v96Hs4/hlnP0PdJM4=' 
WHERE 
  key_id = 'a809ff46e5ae824303c9442094d01ea55653645ee029b78523eee85f7a988618' 
  AND (
    token = 'NdeC3qNZ74fNegtoIIk1zGQYK9v96Hs4/hlnP0PdJM4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058