UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xLoza9VMWu3wgFeKvgwIGFctmFhPqhNsMiOJ6COxhVE=' 
WHERE 
  key_id = '919ae0d0d517ce052a73c0224144c38063fa5cc3ab8e9fcf7de4eb89a43c1875' 
  AND (
    token = 'xLoza9VMWu3wgFeKvgwIGFctmFhPqhNsMiOJ6COxhVE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036