UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RAk9hiICZ5gZqJE1VtpLNiDB4Y+Cz+mCBOJt8bpwPvs=' 
WHERE 
  key_id = 'ce9317b07e7f331d758d9e6a4b213a26a9d36e8d109bcbe3b498a11f7ad4a781' 
  AND (
    token = 'RAk9hiICZ5gZqJE1VtpLNiDB4Y+Cz+mCBOJt8bpwPvs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037