UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dEbEEEgx5Km/7kTXFKzHOb7txV4hZNQmwee8R6ooYms=' 
WHERE 
  key_id = '614525c69861f8a283f0e8655c48504f48eb39015c448cf52f7bf90b49b911e3' 
  AND (
    token = 'dEbEEEgx5Km/7kTXFKzHOb7txV4hZNQmwee8R6ooYms=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024