UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bZxO2IZFv2KcnPxIurnvgWy5OdgY9FzoQZrxH26Ri/E=' 
WHERE 
  key_id = '5b8e515c2bf3ab45c738d8ab9117f037034ea0d114c772ada69607a6c9796408' 
  AND (
    token = 'bZxO2IZFv2KcnPxIurnvgWy5OdgY9FzoQZrxH26Ri/E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027