UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'H2nJO4rmlPD+8Kb90kRCKfPNQ9SWE1WWADJQnAACVIg=' 
WHERE 
  key_id = '05e90abf339e60db7967e15c9e9626c58effee3e9bb6945fa19f530329ff965d' 
  AND (
    token = 'H2nJO4rmlPD+8Kb90kRCKfPNQ9SWE1WWADJQnAACVIg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033