UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jJtLP1ahjCWdkqk5VjKSpkqNemMdZ+3G6elS13LfFvM=' 
WHERE 
  key_id = 'be6231d6be77102ba0fbef2ac8d8ed54a5b30d31515b61dbc4e95c2283732af8' 
  AND (
    token = 'jJtLP1ahjCWdkqk5VjKSpkqNemMdZ+3G6elS13LfFvM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018