UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vnz1jvdGhcowAq1JFcOmPfkiqePbzPXEL4KYHChVulc=' 
WHERE 
  key_id = 'd73848fe252583990b9383ef3ddc56d689941264f1ad1a865689d0fc8b670367' 
  AND (
    token = 'vnz1jvdGhcowAq1JFcOmPfkiqePbzPXEL4KYHChVulc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021