UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HTejQbyVtiJa2Ip5dpZxQo5Gd9eB/T0sxRHTQ9OELfU=' 
WHERE 
  key_id = '128a6117057b727fb890fafd5ad711df1f953312f7eb0a61ef29dcf9394fc40b' 
  AND (
    token = 'HTejQbyVtiJa2Ip5dpZxQo5Gd9eB/T0sxRHTQ9OELfU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031