UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GoY9+EtiD/uBnStQhbVEy9HX3FC/wiHMHenSKqCUxWw=' 
WHERE 
  key_id = '6f56e9cf0cf1755bd1558e5a1ae0208dbd1a4740ff8840df4bbc75b1ad6f4a1b' 
  AND (
    token = 'GoY9+EtiD/uBnStQhbVEy9HX3FC/wiHMHenSKqCUxWw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041