UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xJD87iaO6YdMfugF1mNWjKO8QQcWWMPT4IAD/hRrj3M=' 
WHERE 
  key_id = '3601bd4cb5afea4ff42cbfea0237559e9d60b35a1ad00f7623b49ca2370d8387' 
  AND (
    token = 'xJD87iaO6YdMfugF1mNWjKO8QQcWWMPT4IAD/hRrj3M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037