UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'u+BoGuo1SST11wlwIgLWzpQAjRTkMcgr4rafj7sVt6k=' 
WHERE 
  key_id = '3bea61ce3d38df7face6571e1fa896b9ee09fd884f9fcc0cc302c53b118a5aa5' 
  AND (
    token = 'u+BoGuo1SST11wlwIgLWzpQAjRTkMcgr4rafj7sVt6k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039