UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/TgjSrieeCphvIMr9DFc+JDB6ldO1m6QuKzHOdwC5DQ=' 
WHERE 
  key_id = '2a0d9a2c847556799826fb719a43588492c91521b5d3f7459afe32d413545241' 
  AND (
    token = '/TgjSrieeCphvIMr9DFc+JDB6ldO1m6QuKzHOdwC5DQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028