UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MlGyDK6jhB8yHayY59hl0WOYOss97xywvndHyJdQmxw=' 
WHERE 
  key_id = 'eac440acf202f90745e1abc986caf819314eb5c95d3311f2f4f5ca898cb371b9' 
  AND (
    token = 'MlGyDK6jhB8yHayY59hl0WOYOss97xywvndHyJdQmxw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043